#ifndef _KEY_H_
#define _KEY_H_

#include "stm32f10x.h"
#include "sys.h"
#include "time.h"

typedef enum _MESSAGE
{
	MSG_NONE = 0x00,		 
	
	KEY_MSG_UP,
	KEY_MSG_LONG_UP,
	KEY_MSG_DN,
	KEY_MSG_LONG_DN,
	
} MESSAGE;

#define KEY1_RCC_APB2     RCC_APB2Periph_GPIOA
#define KEY1_GPIO_Pin     GPIO_Pin_0
#define KEY1_GPIO         GPIOA

#define KEY2_RCC_APB2     RCC_APB2Periph_GPIOC
#define KEY2_GPIO_Pin     GPIO_Pin_13
#define KEY2_GPIO         GPIOC

#define KEY1_IN          PAin(0)
#define KEY2_IN          PCin(13)

void Key_Init(void);
int GetKey(void);
uint8_t KeyScan(void);
uint8_t KeyScan_Lock(void);
#endif	/* _KEY_H_*/


